package cn.rui.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 徽州大都督
 * @date 2020/8/12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("admin_name")
public class Admins implements Serializable{

    @TableId(type = IdType.AUTO)
    private Integer aid;

    private String adminUsername;

    private String adminPassword;

    @TableField(exist = false)
    private String sexStr;

    private Integer adminSex;

    private String adminTelephone;

    private String adminEmail;

    private Integer pid;

    private String des;

    private String salt;

    private String perStr;  //拥有权限范围的字符串

    @TableField(exist = false)
    private List<String> per; //拥有权限范围的集合

    @TableField(exist = false)
    private String ip;

    @TableField(exist = false)
    private String adminName;

    @TableField(exist = false)
    private Permissions permissions;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    //@TableField(fill = FieldFill.INSERT_UPDATE)
    private Date loginTime;

    @TableLogic
    private Integer deleted;

    private Integer aStatus;

    private Integer loginCount;

    @TableField(exist = false)
    private Long total;

    @TableField(exist = false)
    private List<Permissions> permList;

    @TableField(exist = false)
    private List<String> menuStr;

}
